pull: override max-conns-per-host to 8, for faster downloads
authorJames Antill <james@and.org>
Fri, 25 Jul 2014 14:08:02 +0000 (10:08 -0400)
committerColin Walters <walters@verbum.org>
Fri, 25 Jul 2014 14:22:55 +0000 (10:22 -0400)
Modern web browsers are all converging on 6 or 8.  Let's match that.

src/libostree/ostree-fetcher.c

index b6dc761fde479a11287bb5240ba5d0eedb587272..a049e0f4c45f36808d21d5c7a371d9c57b434986 100644 (file)
@@ -188,6 +188,14 @@ _ostree_fetcher_init (OstreeFetcher *self)
 
   self->requester = (SoupRequester *)soup_session_get_feature (self->session, SOUP_TYPE_REQUESTER);
   g_object_get (self->session, "max-conns-per-host", &max_conns, NULL);
+  if (max_conns <= 8)
+    { 
+      // We download a lot of small objects in ostree, so this helps a
+      // lot.  Also matches what most modern browsers do.
+      max_conns = 8;
+      g_object_set (self->session, "max-conns-per-host", max_conns, NULL);
+    }
+
   self->max_outstanding = 3 * max_conns;
 
   g_signal_connect (self->session, "request-started",